<html>
<head><meta charset="utf-8"><title>HRTB with early bound lifetimes · wg-traits · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/index.html">wg-traits</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/HRTB.20with.20early.20bound.20lifetimes.html">HRTB with early bound lifetimes</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="235423700"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/HRTB%20with%20early%20bound%20lifetimes/near/235423700" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/HRTB.20with.20early.20bound.20lifetimes.html#235423700">(Apr 20 2021 at 22:05)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> or someone else, do you know why we cant use HRTB with early bound lifetimes? i.e:</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">fn</span> <span class="nf">foo</span><span class="o">&lt;'</span><span class="na">a</span>: <span class="o">'</span><span class="na">a</span><span class="o">&gt;</span><span class="p">(</span><span class="n">_</span>: <span class="kp">&amp;</span><span class="o">'</span><span class="na">a</span> <span class="p">())</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>

<span class="k">fn</span> <span class="nf">main</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">_</span>: <span class="nc">for</span><span class="o">&lt;'</span><span class="na">a</span><span class="o">&gt;</span><span class="w"> </span><span class="k">fn</span><span class="p">(</span><span class="o">&amp;'</span><span class="na">a</span><span class="w"> </span><span class="p">())</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">foo</span><span class="p">;</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>
<p>was investigating an issue and ended up in late bound lifetime shenanigans and now wondering about this <span aria-label="thinking" class="emoji emoji-1f914" role="img" title="thinking">:thinking:</span></p>



<a name="235423838"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/HRTB%20with%20early%20bound%20lifetimes/near/235423838" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/HRTB.20with.20early.20bound.20lifetimes.html#235423838">(Apr 20 2021 at 22:07)</a>:</h4>
<p>I do know why:)</p>



<a name="235423846"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/HRTB%20with%20early%20bound%20lifetimes/near/235423846" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/HRTB.20with.20early.20bound.20lifetimes.html#235423846">(Apr 20 2021 at 22:07)</a>:</h4>
<p>The idea is that HRTBs get erased at monomorphization</p>



<a name="235423864"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/HRTB%20with%20early%20bound%20lifetimes/near/235423864" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/HRTB.20with.20early.20bound.20lifetimes.html#235423864">(Apr 20 2021 at 22:07)</a>:</h4>
<p>err</p>



<a name="235423871"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/HRTB%20with%20early%20bound%20lifetimes/near/235423871" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/HRTB.20with.20early.20bound.20lifetimes.html#235423871">(Apr 20 2021 at 22:07)</a>:</h4>
<p>not quite</p>



<a name="235423907"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/HRTB%20with%20early%20bound%20lifetimes/near/235423907" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/HRTB.20with.20early.20bound.20lifetimes.html#235423907">(Apr 20 2021 at 22:07)</a>:</h4>
<p>Early bound lifetimes do</p>



<a name="235423913"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/HRTB%20with%20early%20bound%20lifetimes/near/235423913" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/HRTB.20with.20early.20bound.20lifetimes.html#235423913">(Apr 20 2021 at 22:07)</a>:</h4>
<p><span class="user-mention" data-user-id="326176">@Boxy</span> <a href="https://smallcultfollowing.com/babysteps/blog/2013/10/29/intermingled-parameter-lists/">this blog post from 2013</a> basically explains it</p>



<a name="235423959"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/HRTB%20with%20early%20bound%20lifetimes/near/235423959" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/HRTB.20with.20early.20bound.20lifetimes.html#235423959">(Apr 20 2021 at 22:08)</a>:</h4>
<p><span class="user-mention" data-user-id="216206">@lcnr</span> ^^</p>



<a name="235423979"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/HRTB%20with%20early%20bound%20lifetimes/near/235423979" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/HRTB.20with.20early.20bound.20lifetimes.html#235423979">(Apr 20 2021 at 22:08)</a>:</h4>
<p><a href="https://rustc-dev-guide.rust-lang.org/early-late-bound.html">https://rustc-dev-guide.rust-lang.org/early-late-bound.html</a></p>



<a name="235423980"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/HRTB%20with%20early%20bound%20lifetimes/near/235423980" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/HRTB.20with.20early.20bound.20lifetimes.html#235423980">(Apr 20 2021 at 22:08)</a>:</h4>
<p>I will read this <span aria-label="thinking" class="emoji emoji-1f914" role="img" title="thinking">:thinking:</span></p>



<a name="235423982"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/HRTB%20with%20early%20bound%20lifetimes/near/235423982" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/HRTB.20with.20early.20bound.20lifetimes.html#235423982">(Apr 20 2021 at 22:08)</a>:</h4>
<p>this may also</p>



<a name="235424002"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/HRTB%20with%20early%20bound%20lifetimes/near/235424002" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/HRTB.20with.20early.20bound.20lifetimes.html#235424002">(Apr 20 2021 at 22:08)</a>:</h4>
<p>..and read that, thank you!</p>



<a name="235428435"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/HRTB%20with%20early%20bound%20lifetimes/near/235428435" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/HRTB.20with.20early.20bound.20lifetimes.html#235428435">(Apr 20 2021 at 22:53)</a>:</h4>
<p>hmm</p>



<a name="235428476"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/HRTB%20with%20early%20bound%20lifetimes/near/235428476" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/HRTB.20with.20early.20bound.20lifetimes.html#235428476">(Apr 20 2021 at 22:54)</a>:</h4>
<p>I have read the linked things</p>



<a name="235428496"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/HRTB%20with%20early%20bound%20lifetimes/near/235428496" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/HRTB.20with.20early.20bound.20lifetimes.html#235428496">(Apr 20 2021 at 22:54)</a>:</h4>
<p>im having a hard time articulating why I'm still having the same confusion <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="235428679"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/HRTB%20with%20early%20bound%20lifetimes/near/235428679" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/HRTB.20with.20early.20bound.20lifetimes.html#235428679">(Apr 20 2021 at 22:56)</a>:</h4>
<p>So, imagine <code>for&lt;'a&gt; fn(&amp;'a ())</code></p>



<a name="235428705"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/HRTB%20with%20early%20bound%20lifetimes/near/235428705" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/HRTB.20with.20early.20bound.20lifetimes.html#235428705">(Apr 20 2021 at 22:56)</a>:</h4>
<p>In this case, you can imagine that there is some monomorphized code for that function</p>



<a name="235428729"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/HRTB%20with%20early%20bound%20lifetimes/near/235428729" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/HRTB.20with.20early.20bound.20lifetimes.html#235428729">(Apr 20 2021 at 22:57)</a>:</h4>
<p>And that function is valid for <em>any</em> lifetime</p>



<a name="235428824"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/HRTB%20with%20early%20bound%20lifetimes/near/235428824" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/HRTB.20with.20early.20bound.20lifetimes.html#235428824">(Apr 20 2021 at 22:58)</a>:</h4>
<p>that makes sense to me so far <span aria-label="thinking" class="emoji emoji-1f914" role="img" title="thinking">:thinking:</span></p>



<a name="235428879"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/HRTB%20with%20early%20bound%20lifetimes/near/235428879" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/HRTB.20with.20early.20bound.20lifetimes.html#235428879">(Apr 20 2021 at 22:58)</a>:</h4>
<p>From the blog post there is also:</p>



<a name="235428881"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/HRTB%20with%20early%20bound%20lifetimes/near/235428881" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/HRTB.20with.20early.20bound.20lifetimes.html#235428881">(Apr 20 2021 at 22:58)</a>:</h4>
<blockquote>
<p>What is important here is that the type parameter A has a bound that references the lifetime parameter 'arena. This means that we cannot know A unless we know 'arena. Since A is a type parameter, and thus early bound, this implies that 'arena must also be early bound.</p>
</blockquote>



<a name="235428938"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/HRTB%20with%20early%20bound%20lifetimes/near/235428938" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/HRTB.20with.20early.20bound.20lifetimes.html#235428938">(Apr 20 2021 at 22:59)</a>:</h4>
<p>I think it mostly comes down to how we verify the constraints on lifetimes and such</p>



<a name="235429119"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/HRTB%20with%20early%20bound%20lifetimes/near/235429119" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/HRTB.20with.20early.20bound.20lifetimes.html#235429119">(Apr 20 2021 at 23:00)</a>:</h4>
<p>In your example, you can't use <code>'a</code> from <code>for&lt;'a&gt;</code> for your early bound lifetime, because we can't use that to verify constraints</p>



<a name="235429896"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/HRTB%20with%20early%20bound%20lifetimes/near/235429896" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/HRTB.20with.20early.20bound.20lifetimes.html#235429896">(Apr 20 2021 at 23:07)</a>:</h4>
<p>I think that makes sense</p>



<a name="235430180"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/HRTB%20with%20early%20bound%20lifetimes/near/235430180" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/HRTB.20with.20early.20bound.20lifetimes.html#235430180">(Apr 20 2021 at 23:10)</a>:</h4>
<p>hmm</p>



<a name="235430190"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/HRTB%20with%20early%20bound%20lifetimes/near/235430190" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/HRTB.20with.20early.20bound.20lifetimes.html#235430190">(Apr 20 2021 at 23:11)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">trait</span><span class="w"> </span><span class="n">Foo</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="k">struct</span> <span class="nc">Bar</span><span class="o">&lt;'</span><span class="na">a</span><span class="o">&gt;</span><span class="p">(</span><span class="o">&amp;'</span><span class="na">a</span><span class="w"> </span><span class="p">());</span><span class="w"></span>

<span class="k">impl</span><span class="o">&lt;'</span><span class="na">a</span><span class="o">&gt;</span><span class="w"> </span><span class="n">Foo</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">Bar</span><span class="o">&lt;'</span><span class="na">a</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>

<span class="k">fn</span> <span class="nf">foo</span><span class="o">&lt;'</span><span class="na">a</span><span class="o">&gt;</span><span class="p">(</span><span class="n">_</span>: <span class="kp">&amp;</span><span class="o">'</span><span class="na">a</span> <span class="p">())</span><span class="w"> </span><span class="k">where</span><span class="w"> </span><span class="n">Bar</span><span class="o">&lt;'</span><span class="na">a</span><span class="o">&gt;</span>: <span class="nc">Foo</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>

<span class="k">fn</span> <span class="nf">main</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">_</span>: <span class="nc">for</span><span class="o">&lt;'</span><span class="na">a</span><span class="o">&gt;</span><span class="w"> </span><span class="k">fn</span><span class="p">(</span><span class="o">&amp;'</span><span class="na">a</span><span class="w"> </span><span class="p">())</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">foo</span><span class="p">;</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="235430194"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/HRTB%20with%20early%20bound%20lifetimes/near/235430194" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/HRTB.20with.20early.20bound.20lifetimes.html#235430194">(Apr 20 2021 at 23:11)</a>:</h4>
<p>if I have something liek this for example</p>



<a name="235430214"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/HRTB%20with%20early%20bound%20lifetimes/near/235430214" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/HRTB.20with.20early.20bound.20lifetimes.html#235430214">(Apr 20 2021 at 23:11)</a>:</h4>
<p>why can <code>foo</code> not have <code>'a</code> be late bound</p>



<a name="235430231"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/HRTB%20with%20early%20bound%20lifetimes/near/235430231" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/HRTB.20with.20early.20bound.20lifetimes.html#235430231">(Apr 20 2021 at 23:11)</a>:</h4>
<p><code>for&lt;'a&gt; Bar&lt;'a&gt;: Foo</code> holds</p>



<a name="235430239"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/HRTB%20with%20early%20bound%20lifetimes/near/235430239" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/HRTB.20with.20early.20bound.20lifetimes.html#235430239">(Apr 20 2021 at 23:12)</a>:</h4>
<p>is this something that <em>could</em> be done but just isnt?</p>



<a name="235430295"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/HRTB%20with%20early%20bound%20lifetimes/near/235430295" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/HRTB.20with.20early.20bound.20lifetimes.html#235430295">(Apr 20 2021 at 23:12)</a>:</h4>
<p>or am I maybe missing some reason as to why this would be incorrect to do</p>



<a name="235431652"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/HRTB%20with%20early%20bound%20lifetimes/near/235431652" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/HRTB.20with.20early.20bound.20lifetimes.html#235431652">(Apr 20 2021 at 23:28)</a>:</h4>
<p>I atleast get why "HRTB with early bound lifetimes" makes not much sense <span aria-label="thinking" class="emoji emoji-1f914" role="img" title="thinking">:thinking:</span> I think im now just confused why my lifetime is early bound not late bound</p>



<a name="235431942"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/HRTB%20with%20early%20bound%20lifetimes/near/235431942" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/HRTB.20with.20early.20bound.20lifetimes.html#235431942">(Apr 20 2021 at 23:32)</a>:</h4>
<p><span class="user-mention" data-user-id="326176">@Boxy</span> it's because <code>'a: 'a</code></p>



<a name="235431988"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/HRTB%20with%20early%20bound%20lifetimes/near/235431988" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/HRTB.20with.20early.20bound.20lifetimes.html#235431988">(Apr 20 2021 at 23:32)</a>:</h4>
<p>that's a where clause</p>



<a name="235432053"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/HRTB%20with%20early%20bound%20lifetimes/near/235432053" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/HRTB.20with.20early.20bound.20lifetimes.html#235432053">(Apr 20 2021 at 23:32)</a>:</h4>
<p>whenever a lifetime appears in a where clause (at least presently) we call it early bound</p>



<a name="235432131"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/HRTB%20with%20early%20bound%20lifetimes/near/235432131" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/HRTB.20with.20early.20bound.20lifetimes.html#235432131">(Apr 20 2021 at 23:33)</a>:</h4>
<p>the way is works is that when we evaluate <code>foo</code> you get a value, and you introduce the where clauses at that time and prove them true</p>



<a name="235432149"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/HRTB%20with%20early%20bound%20lifetimes/near/235432149" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/HRTB.20with.20early.20bound.20lifetimes.html#235432149">(Apr 20 2021 at 23:33)</a>:</h4>
<p>(note that in an ideal world I think we could erase some of these differences)</p>



<a name="235432328"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/HRTB%20with%20early%20bound%20lifetimes/near/235432328" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/HRTB.20with.20early.20bound.20lifetimes.html#235432328">(Apr 20 2021 at 23:35)</a>:</h4>
<p>what are the differences you're talking about?</p>



<a name="235432662"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/HRTB%20with%20early%20bound%20lifetimes/near/235432662" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/HRTB.20with.20early.20bound.20lifetimes.html#235432662">(Apr 20 2021 at 23:39)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/144729-wg-traits/topic/HRTB.20with.20early.20bound.20lifetimes/near/235432053">said</a>:</p>
<blockquote>
<p>whenever a lifetime appears in a where clause (at least presently) we call it early bound</p>
</blockquote>
<p>I think the "at least presently" somewhat answers my previous question though <span aria-label="thinking" class="emoji emoji-1f914" role="img" title="thinking">:thinking:</span></p>



<a name="235440518"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/HRTB%20with%20early%20bound%20lifetimes/near/235440518" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/HRTB.20with.20early.20bound.20lifetimes.html#235440518">(Apr 21 2021 at 01:18)</a>:</h4>
<p><span class="user-mention silent" data-user-id="326176">Boxy</span> <a href="#narrow/stream/144729-wg-traits/topic/HRTB.20with.20early.20bound.20lifetimes/near/235432328">said</a>:</p>
<blockquote>
<p>what are the differences you're talking about?</p>
</blockquote>
<p>I mean the whole distinction between early and late bound -- I think that with chalk or a more flexible solver we could lighten some of these distinctions</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>